/* WordCardStyles.css - 包含所有卡片样式 */

.word-card-container {
  perspective: 1000px;
  width: 100%;
  max-width: min(90vw, 450px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.word-card {
  width: 100%;
  height: calc(min(85vh, 600px) - 50px);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* 第一面 - 默认显示 */
.card-face-0 {
  background: linear-gradient(135deg, #1cb5e0 0%, #000851 100%);
  color: white;
  transform: rotateY(0deg);
  z-index: 3;
}

/* 第二面 */
.card-face-1 {
  background: white;
  color: #333;
  transform: rotateY(180deg);
  z-index: 2;
}

/* 第三面 */
.card-face-2 {
  background: #f8f9fa;
  color: #333;
  transform: rotateY(360deg);
  z-index: 1;
}

/* 第四面 */
.card-face-3 {
  background: linear-gradient(135deg, #1cb5e0 0%, #000851 100%);
  color: white;
  transform: rotateY(540deg);
  z-index: 0;
}

/* 翻转到第二面 */
.word-card.flipped-1 {
  transform: rotateY(180deg);
}

/* 翻转到第二面时的 z-index 调整 */
.word-card.flipped-1 .card-face-1 {
  z-index: 3;
}

/* 翻转到第三面 */
.word-card.flipped-2 {
  transform: rotateY(360deg);
}

/* 翻转到第三面时的 z-index 调整 */
.word-card.flipped-2 .card-face-2 {
  z-index: 3;
}

/* 翻转到第四面 */
.word-card.flipped-3 {
  transform: rotateY(540deg);
}

/* 翻转到第四面时的 z-index 调整 */
.word-card.flipped-3 .card-face-3 {
  z-index: 4;
}

/* 单词内容样式 */
.word-content {
  text-align: center;
}

/* 为 card-face-0 中的 word 设置白色字体和加粗 */
.card-face-0 .word {
  font-size: 3rem;
  margin-bottom: 10px;
  color: white;
  font-weight: bold;
}

/* 其他面的单词样式 */
.card-face-1 .word,
.card-face-2 .word,
.card-face-3 .word {
  font-size: 3rem;
  margin-bottom: 10px;
}

.phonetic {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.difficulty-indicator {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  margin: 15px 0;
  background-color: rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.star-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bi-star-fill {
  color: gold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.bi-star {
  color: rgba(255, 255, 255, 0.5);
}

/* 第二面样式 */
.image-container {
  width: 100%;
  height: 50%;
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 10px;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meaning-container {
  width: 100%;
  text-align: center;
}

.meaning {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.word-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 15px;
  background-color: #e9ecef;
  font-size: 0.9rem;
}

/* 第三面样式 */
.animation-container {
  width: 100%;
  height: 50%;
  margin-bottom: 15px;
}

.animation-placeholder {
  width: 100%;
  height: 100%;
  background-color: #dee2e6;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.example-container {
  width: 100%;
  text-align: center;
}

.example {
  font-size: 1.2rem;
  font-style: italic;
  margin-bottom: 8px;
}

.example-translation {
  color: #6c757d;
  margin-bottom: 15px;
}

/* 按钮样式 */
.play-button {
  background-color: rgba(255, 255, 255, 0.25);
  border: none;
  color: inherit;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.play-button:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.card-face-1 .play-button,
.card-face-2 .play-button {
  background-color: #e9ecef;
  color: #333;
}

.card-face-1 .play-button:hover,
.card-face-2 .play-button:hover {
  background-color: #ced4da;
}

/* 第四面样式 */
.explanation-container {
  width: 100%;
  padding: 15px;
  text-align: left;
}

.word-explanation {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.6;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 4px 12px;
  font-size: 0.8rem;
}

.word-notes h4 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.word-notes textarea {
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  color: #333;
  width: 100%;
}

/* 滑动动画效果 */
@keyframes slide-up {
  0% {
    transform: translateY(0) rotateY(var(--rotateY));
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotateY(var(--rotateY));
    opacity: 0;
  }
}

@keyframes slide-down {
  0% {
    transform: translateY(0) rotateY(var(--rotateY));
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotateY(var(--rotateY));
    opacity: 0;
  }
}

.card-face-0.swipe-up {
  --rotateY: 0deg;
  animation: slide-up 0.6s forwards;
}

.card-face-0.swipe-down {
  --rotateY: 0deg;
  animation: slide-down 0.6s forwards;
}

.card-face-1.swipe-up {
  --rotateY: 180deg;
  animation: slide-up 0.6s forwards;
}

.card-face-1.swipe-down {
  --rotateY: 180deg;
  animation: slide-down 0.6s forwards;
}

.card-face-2.swipe-up {
  --rotateY: 360deg;
  animation: slide-up 0.6s forwards;
}

.card-face-2.swipe-down {
  --rotateY: 360deg;
  animation: slide-down 0.6s forwards;
}

.card-face-3.swipe-up {
  --rotateY: 540deg;
  animation: slide-up 0.6s forwards;
}

.card-face-3.swipe-down {
  --rotateY: 540deg;
  animation: slide-down 0.6s forwards;
}

/* 入场动画效果 */
@keyframes enter-from-top {
  0% {
    transform: translateY(-100vh) rotateY(var(--rotateY));
    opacity: 0;
  }
  50% {
    transform: translateY(-20px) rotateY(var(--rotateY));
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) rotateY(var(--rotateY));
    opacity: 1;
  }
}

@keyframes enter-from-bottom {
  0% {
    transform: translateY(100vh) rotateY(var(--rotateY));
    opacity: 0;
  }
  50% {
    transform: translateY(20px) rotateY(var(--rotateY));
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) rotateY(var(--rotateY));
    opacity: 1;
  }
}

.card-face-0.enter-from-top {
  --rotateY: 0deg;
  animation: enter-from-top 0.7s ease-out forwards;
}

.card-face-0.enter-from-bottom {
  --rotateY: 0deg;
  animation: enter-from-bottom 0.7s ease-out forwards;
}

.card-face-1.enter-from-top {
  --rotateY: 180deg;
  animation: enter-from-top 0.7s ease-out forwards;
}

.card-face-1.enter-from-bottom {
  --rotateY: 180deg;
  animation: enter-from-bottom 0.7s ease-out forwards;
}

.card-face-2.enter-from-top {
  --rotateY: 360deg;
  animation: enter-from-top 0.7s ease-out forwards;
}

.card-face-2.enter-from-bottom {
  --rotateY: 360deg;
  animation: enter-from-bottom 0.7s ease-out forwards;
}

.card-face-3.enter-from-top {
  --rotateY: 540deg;
  animation: enter-from-top 0.7s ease-out forwards;
}

.card-face-3.enter-from-bottom {
  --rotateY: 540deg;
  animation: enter-from-bottom 0.7s ease-out forwards;
}

/* 响应式样式调整 */
@media (max-height: 700px) {
  .word-card {
    height: calc(92vh - 50px);
  }

  .card-face-0 .word {
    font-size: 2.5rem;
  }

  .phonetic {
    font-size: 1rem;
    margin-bottom: 15px;
  }

  .meaning {
    font-size: 1.3rem;
  }

  .card-face {
    padding: 15px;
  }
}

@media (max-height: 500px) {
  .word-card {
    height: calc(95vh - 40px);
  }

  .card-face-0 .word {
    font-size: 2rem;
  }

  .phonetic {
    margin-bottom: 10px;
  }

  .card-face {
    padding: 10px;
  }
}